﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using NesGfx;

namespace cnetmegamanprj
{
    public partial class SimpleTileDisplay : Form
    {
        int mply = 2;
        Bitmap bmp = new Bitmap(256, 256);
        Render render = null;
        int levelNumber;
        MegaMan mm;

        public SimpleTileDisplay(MegaMan mm_)
        {
            mm = mm_;
            InitializeComponent();
        }

        private void SimpleTileDisplay_Load(object sender, EventArgs e)
        {
            pictureBox1.Width = bmp.Width;
            pictureBox1.Height = bmp.Height;
            pictureBox1.Image = bmp;
            render = new Render(bmp, mply);
            mm.drawTiles(levelNumber, render);
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            levelNumber++;
            if (levelNumber == mm.levelCount)
                levelNumber = 0;

            mm.drawTiles(levelNumber, render);
            pictureBox1.Invalidate();
        }
    }
}
